{template 'header', 'member'}

<script type="text/javascript">c(1);</script>
<div class="tinfo">
<div class="menu">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="tab" id="add"><a href="{$AJ[file_my]}?mid={$mid}&action=add"><span>添加{$MOD[name]}</span></a></td>
{if $_userid}
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="s3"><a href="{$AJ[file_my]}?mid={$mid}"><span>已发布<span class="px10">({$nums[3]})</span></span></a></td>
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="s2"><a href="{$AJ[file_my]}?mid={$mid}&status=2"><span>审核中<span class="px10">({$nums[2]})</span></span></a></td>
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="s1"><a href="{$AJ[file_my]}?mid={$mid}&status=1"><span>未通过<span class="px10">({$nums[1]})</span></span></a></td>
{/if}
</tr>
</table>
</div>
{if $action=='add' || $action=='edit'}
{load('page.js')}
<iframe src="" name="send" id="send" style="display:none;"></iframe>
<form method="post" action="{$AJ[file_my]}" id="dform" target="send" onsubmit="return check();">
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="mid" value="{$mid}"/>
<input type="hidden" name="itemid" value="{$itemid}"/>
<input type="hidden" name="forward" value="{$forward}"/>
</div>
<table cellpadding="6" cellspacing="1" class="tbs">
{if $status==1 && $action=='edit' && $note}
<tr>
<td class="tl">未通过原因</td>
<td class="tr f_blue">{$note}</td>
</tr>
{/if}
<tr>
<td class="tl"><span class="f_red">*</span> 所属分类</td>
<td class="tr">{category_select('post[catid]', '选择分类', $catid, $moduleid)} <span id="dcatid" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> {$MOD[name]}标题</td>
<td class="tr"><input name="post[title]" type="text" id="title" size="50" value="{$title}"/> <span id="dtitle" class="f_red"></span></td>
</tr>
{if $action=='add' && $could_color}
<tr>
<td class="tl">标题颜色</td>
<td class="tr">
{dstyle('color')}&nbsp;
设置信息标题颜色需消费 <strong class="f_red">{$MOD[credit_color]}</strong> {$AJ[credit_name]}
</td>
</tr>
{/if}
<tr><td class="tl"><font class="hide">*</font>所属楼盘</td>
            <td><input type="text" class="txt" id="villagename" name="post[housename]" value="{$housename}"  >
					<input type="hidden" name="post[houseid]" id="cid" value="">
					<p class="gray9">请输入小区名称，如：“青园”或“qyxq”，然后在下面打开的列表中选择即可。</p>
					
					<div id="autoVn"></div>	
							         
									</td>
          </tr>
<tr>
<td class="tl"><span class="f_red">*</span> 标题图片</td>
<td class="tr"><input name="post[thumb]" id="thumb" type="text" size="60" value="{$thumb}" readonly/>&nbsp;&nbsp;<a href="javascript:void(0);" onclick="Dthumb({$moduleid},{$MOD[thumb_width]},{$MOD[thumb_height]}, Dd('thumb').value, true);" class="t">[上传]</a>&nbsp;&nbsp;<a href="javascript:void(0);" onclick="_preview(Dd('thumb').value);" class="t">[预览]</a>&nbsp;&nbsp;<a href="javascript:void(0);" onclick="Dd('thumb').value='';" class="t">[删除]</a> <span id="dthumb" class="f_red"></span></td>
</tr>
{if $MOD[swfu]==1 && $MG[upload] && check_group($_groupid, $MOD[group_upload])}
<tr>
<td class="tl"><span class="f_red">*</span> {$MOD[name]}地址</td>
<td class="tr"><div style="float:left;"><input name="post[video]" id="video" type="text" size="60" value="{$video}" onblur="UpdateURL();"/>&nbsp;&nbsp;</div><div style="width:34px;height:20px;float:left;"><span id="spanButtonPlaceHolder"></span></div><table cellspacing="0" style="display:none;">
<tr>
	<td>Files Queued:</td>
	<td id="tdFilesQueued"></td>
</tr>			
<tr>
	<td>Files Uploaded:</td>
	<td id="tdFilesUploaded"></td>
</tr>			
<tr>
	<td>Errors:</td>
	<td id="tdErrors"></td>
</tr>
<tr>
	<td>Current Speed:</td>
	<td id="tdCurrentSpeed"></td>
</tr>			
<tr>
	<td>Average Speed:</td>
	<td id="tdAverageSpeed"></td>
</tr>			
<tr>
	<td>Moving Average Speed:</td>
	<td id="tdMovingAverageSpeed"></td>
</tr>			
<tr>
	<td>Time Remaining</td>
	<td id="tdTimeRemaining"></td>
</tr>			
<tr>
	<td>Time Elapsed</td>
	<td id="tdTimeElapsed"></td>
</tr>
<tr>
	<td>Size Uploaded</td>
	<td id="tdSizeUploaded"></td>
</tr>			
<tr>
	<td>Progress Event Count</td>
	<td id="tdProgressEventCount"></td>
</tr>	
</table>
<div style="float:left;">&nbsp;&nbsp;<span onclick="vs();" class="jt">[预览]</span>&nbsp;&nbsp;<span onclick="vh();Dd('video').value='';" class="jt">[删除]</span>&nbsp;&nbsp; 
<span class="f_gray">进度：<span id="tdPercentUploaded">0%</span></span> <span id="dvideo" class="f_red"></span></div>
<script type="text/javascript" src="{$MODULE[1][linkurl]}api/swfupload/swfupload.js"></script>
<script type="text/javascript" src="{$MODULE[1][linkurl]}api/swfupload/swfupload.queue.js"></script>
<script type="text/javascript" src="{$MODULE[1][linkurl]}api/swfupload/swfupload.speed.js"></script>
<script type="text/javascript" src="{$MODULE[1][linkurl]}api/swfupload/handlers_video.js"></script>
<script type="text/javascript">
	var swfu;
	/* window.onload = function() { */
		var settings = {
			flash_url : "{$MODULE[1][linkurl]}api/swfupload/swfupload.swf",
			upload_url: "{$MODULE[1][linkurl]}upload.php",
			post_params: {"from": "file", "width": "100", "height": "100", "swf_userid": "{$_userid}", "swf_username": "{$_username}", "swf_groupid": "{$_groupid}", "swf_company": "{$_company}", "swf_auth": "{md5($_userid.$_username.$_groupid.$_company.AJ_KEY.$AJ_IP)}", "swfupload": "1"},
			file_size_limit : "1000 MB",
			/* file_types : "*.*", */
			file_types : "*.{str_replace('|', ';*.', $MOD['upload'])}",
			file_types_description : "视频文件",
			/* /file_upload_limit : 100, */
			file_upload_limit : 10,
			file_queue_limit : 0,

			debug: false,

			button_image_url: "{$MODULE[1][linkurl]}api/swfupload/upload2.png",
			button_width: "34",
			button_height: "20",
			button_placeholder_id: "spanButtonPlaceHolder",
			
			moving_average_history_size: 40,
			
			file_queued_handler : fileQueued,
			file_dialog_complete_handler: fileDialogComplete,
			upload_start_handler : uploadStart,
			upload_progress_handler : uploadProgress,
			upload_success_handler : uploadSuccess,
			upload_complete_handler : uploadComplete,
			
			custom_settings : {
				tdFilesQueued : document.getElementById("tdFilesQueued"),
				tdFilesUploaded : document.getElementById("tdFilesUploaded"),
				tdErrors : document.getElementById("tdErrors"),
				tdCurrentSpeed : document.getElementById("tdCurrentSpeed"),
				tdAverageSpeed : document.getElementById("tdAverageSpeed"),
				tdMovingAverageSpeed : document.getElementById("tdMovingAverageSpeed"),
				tdTimeRemaining : document.getElementById("tdTimeRemaining"),
				tdTimeElapsed : document.getElementById("tdTimeElapsed"),
				tdPercentUploaded : document.getElementById("tdPercentUploaded"),
				tdSizeUploaded : document.getElementById("tdSizeUploaded"),
				tdProgressEventCount : document.getElementById("tdProgressEventCount")
			}
		};
		swfu = new SWFUpload(settings);
	 /* }; */
</script>
</td>
</tr>
{else}
<tr>
<td class="tl"><span class="f_red">*</span> {$MOD[name]}地址</td>
<td class="tr"><input name="post[video]" type="text" id="video" size="60" value="{$video}" onblur="UpdateURL();"/>{if $MG[upload] && check_group($_groupid, $MOD[group_upload])}&nbsp;&nbsp;<span onclick="Dfile({$moduleid}, Dd('video').value, 'video', '{$MOD[upload]}');" class="jt">[上传]</span>{/if}&nbsp;&nbsp;<span onclick="vs();" class="jt">[预览]</span>&nbsp;&nbsp;<span onclick="Dd('video').value='';" class="jt">[删除]</span> <span id="dvideo" class="f_red"></span>
</td>
</tr>
{/if}
<tr>
<td class="tl"><span class="f_red">*</span> {$MOD[name]}宽度</td>
<td class="tr"><input name="post[width]" id="width" type="text" size="5" value="{$width}"/> px&nbsp;&nbsp;&nbsp;高度 <input name="post[height]" id="height" type="text" size="5" value="{$height}"/> px <span id="dsize" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 播放器</td>
<td class="tr">
{loop $PLAYER $k $v}
<input type="radio" name="post[player]" id="type_{$k}" value="{$k}"{if $k == $player} checked{/if}/><label for="type_{$k}"> {$v}</label> 
{/loop}
<div id="v_player"></div>
</td>
</tr>
{if $CP}
<script type="text/javascript">
var property_catid = {$catid};
var property_itemid = {$itemid};
var property_admin = 0;
</script>
<script type="text/javascript" src="{AJ_STATIC}file/script/property.js"></script>
{if $itemid}<script type="text/javascript">setTimeout("load_property()", 1000);</script>{/if}
<tbody id="load_property" style="display:none;">
<tr><td></td><td></td></tr>
</tbody>
{/if}
{if $FD}{fields_html('<td class="tl">', '<td class="tr">', $item)}{/if}
<tr>
<td class="tl">{$MOD[name]}说明</td>
<td class="tr"><textarea name="post[content]" id="content" class="dsn">{$content}</textarea>{deditor($moduleid, 'content', $group_editor, '98%', 350)}</td>
</tr>
{if $fee_add}
<tr>
<td class="tl">发布此信息需消费</td>
<td class="tr"><span class="f_b f_red">{$fee_add}</span> {$fee_unit}</td>
</tr>
{if $fee_currency == 'money'}
<tr>
<td class="tl">{$AJ[money_name]}余额</td>
<td class="tr"><span class="f_blue f_b">{$_money}{$fee_unit}</span> <a href="charge.php?action=pay" target="_blank" class="t">[充值]</a></td>
</tr>
{else}
<tr>
<td class="tl">{$AJ[credit_name]}余额</td>
<td class="tr"><span class="f_blue f_b">{$_credit}{$fee_unit}</span> <a href="credit.php?action=buy" target="_blank" class="t">[购买]</a></td>
</tr>
{/if}
{/if}
{if $need_password}
<tr>
<td class="tl"><span class="f_red">*</span> 支付密码</td>
<td class="tr">{template 'password', 'chip'} <span id="dpassword" class="f_red"></span></td>
</tr>
{/if}
{if $need_question}
<tr>
<td class="tl"><span class="f_red">*</span> 验证问题</td>
<td class="tr">{template 'question', 'chip'} <span id="danswer" class="f_red"></span></td>
</tr>
{/if}
{if $need_captcha}
<tr>
<td class="tl"><span class="f_red">*</span> 验证码</td>
<td class="tr">{template 'captcha', 'chip'} <span id="dcaptcha" class="f_red"></span></td>
</tr>
{/if}
{if $action=='add'}
<tr style="display:none;" id="weibo_sync">
<td class="tl">同步主题</td>
<td class="tr" id="weibo_show"></td>
</tr>
{/if}
<tr>
<td class="tl">&nbsp;</td>
<td class="tr" height="50"><input type="submit" name="submit" value=" 提 交 " class="sBtn"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value=" 返 回 " class="sBtn" onclick="history.back(-1);"/></td>
</tr>
</table>
</form>

<script type="text/javascript">
seajs.use("jjrfbconlp",function(fb){
	fb.init("esf",{
  autoc:AGENT_URL + "house.php?action=loupan"});
})
</script>
{load('clear.js')}
{if $action=='add'}
<script type="text/javascript">s('mid_{$mid}');m('{$action}');</script>
{else}
<script type="text/javascript">s('mid_{$mid}');m('s{$status}');</script>
{/if}
{else}
<div class="tt">
<form action="{$AJ[file_my]}">
<input type="hidden" name="mid" value="{$mid}"/>
<input type="hidden" name="status" value="{$status}"/>
&nbsp;{category_select('catid', '不限分类', $catid, $moduleid)}&nbsp;
<input type="text" size="50" name="kw" value="{$kw}" title="关键词"/>&nbsp;
<input type="submit" value=" 搜 索 " class="sBtn"/>
<input type="button" value=" 重 置 " class="sBtn" onclick="Go('{$AJ[file_my]}?mid={$mid}&status={$status}');"/>
</form>
</div>
<div class="ls">
<form method="post">
<table cellpadding="0" cellspacing="0" class="tb">
<tr>
<th width="20"><input type="checkbox" onclick="checkall(this.form);"/></th>
<th>图 片</th>
<th>标 题</th>
<th>分 类</th>
<th>{if $timetype=='add'}添加{else}更新{/if}时间</th>
<th>播放</th>
<th width="50">管理</th>
</tr>
{loop $lists $k $v}
<tr onmouseover="this.className='on';" onmouseout="this.className='';" align="center">
<td><input type="checkbox" name="itemid[]" value="{$v[itemid]}"/></td>
<td><a href="javascript:_preview('{$v[thumb]}');"><img src="{$v[thumb]}" width="60" class="thumb"/></a></td>
<td align="left" title="{$v[alt]}">&nbsp;{if $v[status]==3}<a href="{$v[linkurl]}" target="_blank" class="t">{else}<a href="{$AJ[file_my]}?mid={$mid}&action=edit&itemid={$v[itemid]}" class="t">{/if}{$v[title]}</a>{if $v[status]==1 && $v[note]} <a href="javascript:" onclick="alert('{$v[note]}');"><img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/why.gif" title="未通过原因"/></a>{/if}</td>
<td>&nbsp;&nbsp;<a href="{$v[caturl]}" target="_blank">{$v[catname]}</a>&nbsp;&nbsp;</td>
{if $timetype=='add'}
<td class="f_gray px11" title="更新时间 {$v[editdate]}">{$v[adddate]}</td>
{else}
<td class="f_gray px11" title="添加时间 {$v[adddate]}">{$v[editdate]}</td>
{/if}
<td class="f_gray px11">{$v[hits]}</td>
<td>
<a href="{$AJ[file_my]}?mid={$mid}&action=edit&itemid={$v[itemid]}"><img width="16" height="16" src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/edit.png" title="修改" alt=""/></a>
{if $MG[delete]}&nbsp;<a href="{$AJ[file_my]}?mid={$mid}&action=delete&itemid={$v[itemid]}" onclick="return confirm('确定要删除吗？此操作将不可撤销');"><img width="16" height="16" src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/delete.png" title="删除" alt=""/></a>{/if}
</td>
</tr>
{/loop}
</table>
</div>
{if $MG[delete]}
<div class="btns">
<input type="submit" value=" 删除选中 " class="sBtn" onclick="if(confirm('确定要删除选中{$MOD[name]}吗？')){this.form.action='?mid={$mid}&status={$status}&action=delete'}else{return false;}"/>
</div>
{/if}
</form>
{if $MG[video_limit] || (!$MG['fee_mode'] && $MOD[fee_add])}
<div class="limit">
{if $MG[video_limit]}
总共可发 <span class="f_b f_red">{$MG[video_limit]}</span> 条&nbsp;&nbsp;&nbsp;
当前已发 <span class="f_b">{$limit_used}</span> 条&nbsp;&nbsp;&nbsp;
还可以发 <span class="f_b f_blue">{$limit_free}</span> 条&nbsp;&nbsp;&nbsp;
{/if}
{if !$MG['fee_mode'] && $MOD[fee_add]}
发布信息收费 <span class="f_b f_red">{$MOD[fee_add]}</span> {if $MOD[fee_currency] == 'money'}{$AJ[money_unit]}{else}{$AJ[credit_unit]}{/if}/条&nbsp;&nbsp;&nbsp;
可免费发布 <span class="f_b">{if $MG[video_free_limit]<0}无限{else}{$MG[video_free_limit]}{/if}</span> 条&nbsp;&nbsp;&nbsp;
{/if}
</div>
{/if}
<div class="pages">{$pages}</div>
<script type="text/javascript">s('mid_{$mid}');m('s{$status}');</script>
{/if}
{if $action == 'add' || $action == 'edit'}
{load('player.js')}
{load('url2video.js')}
<script type="text/javascript">
function check() {
	var l;
	var f;
	f = 'catid_1';
	if(Dd(f).value == 0) {
		Dmsg('请选择所属分类', 'catid', 1);
		return false;
	}
	f = 'title';
	l = Dd(f).value.length;
	if(l < 5 || l > 30) {
		Dmsg('标题应为5-30字，当前已输入'+l+'字', f);
		return false;
	}
	f = 'thumb';
	l = Dd(f).value.length;
	if(l < 10) {
		Dmsg('请上传标题图片', f);
		return false;
	}
	UpdateURL();
	f = 'video';
	l = Dd(f).value.length;
	if(l < 10) {
		Dmsg('请填写视频地址', f);
		return false;
	}
	if(!Dd('width').value) {
		Dmsg('请填写视频宽度', 'size');
		return false;
	}
	if(!Dd('height').value) {
		Dmsg('请填写视频高度', 'size');
		return false;
	}
	{if $FD}{fields_js()}{/if}
{if $need_password}
	f = 'password';
	l = Dd(f).value.length;
	if(l < 6) {
		Dmsg('请填写支付密码', f);
		return false;
	}
{/if}
{if $need_question}
	f = 'answer';
	l = Dd(f).value.length;
	if(l < 1) {
		Dmsg('请填写验证问题', f);
		return false;
	}
	if(Dd('c'+f).innerHTML.indexOf('error') != -1) {
		Dd(f).focus();
		return false;
	}
{/if}
{if $need_captcha}
	f = 'captcha';
	l = Dd(f).value;
	if(!is_captcha(l)) {
		Dmsg('请填写正确的验证码', f);
		return false;
	}
	if(Dd('c'+f).innerHTML.indexOf('error') != -1) {
		Dd(f).focus();
		return false;
	}
{/if}
	return true;
}
function vs() {
	UpdateURL();
	if(Dd('video').value.length > 5) {
		var p = i = 0;
		while(i < 100) {
			if(Dd('type_'+i).checked) {p = i;break}
			i++;
		}
		Ds('v_player');
		Inner('v_player', player(Dd('video').value,Dd('width').value,Dd('height').value,p,1)+'<br/><a href="javascript:" onclick="vh();" class="t">[关闭预览]</a>');
	} else {
		vh();
	}
}
function vh() {Inner('v_player', '');Dh('v_player');}
function UpdateURL() {
	var str = url2video(Dd('video').value);
	if(str) Dd('video').value = str;
}
var aijiacms_oauth = '{$EXT[oauth]}';
</script>
{/if}
{if $action=='add' && strlen($EXT[oauth]) > 1}{load('weibo.js')}{/if}
</div></div></div>
{template 'footer'}